package com.love.poetry.infrastructure.persist.poetry.impl;

import org.springframework.stereotype.Repository;

import com.love.poetry.domain.poetry.Verse;
import com.love.poetry.infrastructure.persist.poetry.VerseRepository;
import com.youboy.core.orm.mybatis.MybatisRepositorySupport;

@Repository
public class MybatisVerseRepository extends MybatisRepositorySupport<String, Verse> implements VerseRepository {
	
	@Override
	protected String getNamespace() {
		return "com.love.poetry.domain.poetry.Verse";
	}
	
	@Override
	public void delete(String id) {
		getSqlSession().delete(getNamespace()+".delete",id);
	}
	
	@Override
	public Verse queryUniqueByName(String name) {
		return (Verse)getSqlSession().selectOne(getNamespace()+".queryUniqueByName", name);
	}
}